export default {
  extends: ["@commitlint/config-conventional"],
  rules: {
    "body-leading-blank": [1, "always"],
    "body-max-line-length": [2, "always", 100],
    "footer-leading-blank": [1, "always"],
    "footer-max-line-length": [2, "always", 100],
    "header-max-length": [2, "always", 100],
    "header-trim": [2, "always"],
    "subject-case": [2, "never", ["sentence-case", "start-case", "pascal-case", "upper-case"]],
    "subject-empty": [2, "never"],
    "subject-full-stop": [2, "never", "."],
    "type-case": [2, "always", "lower-case"],
    "type-empty": [2, "never"],
    "type-enum": [
      2,
      "always",
      [
        "build",
        "chore",
        "ci",
        "docs",
        "feat",
        "fix",
        "perf",
        "refactor",
        "revert",
        "style",
        "test",
      ],
    ],
    "scope-enum": [2, "always", ["全局", "组件", "登录"]],
  },
  helpUrl: "https://github.com/conventional-changelog/commitlint/#what-is-commitlint",
  prompt: {
    settings: {},
    messages: {
      skip: ": 按 enter 跳过",
      max: "最多 %d 字符",
      min: "最少 %d 字符",
      emptyWarning: "不能为空",
      upperLimitWarning: "超过限制",
      lowerLimitWarning: "低于限制",
    },
    questions: {
      type: {
        description: "选择您要提交的更改类型",
        enum: {
          feat: {
            description: "一个新功能",
            title: "Features",
            emoji: "✨ ",
          },
          fix: { description: "错误修复", title: "Bug Fixes", emoji: "🐛" },
          docs: {
            description: "仅文档更改",
            title: "Documentation",
            emoji: "📚 ",
          },
          style: {
            description: "样式更改 (white-space, formatting, missing semi-colons, etc)",
            title: "Styles",
            emoji: "💎",
          },
          refactor: {
            description: "代码重构，既不修复错误也不添加功能的代码更改",
            title: "Code Refactoring",
            emoji: "📦",
          },
          perf: {
            description: "提高性能的代码更改",
            title: "Performance Improvements",
            emoji: "🚀",
          },
          test: {
            description: "添加缺失的测试或纠正现有测试",
            title: "Tests",
            emoji: "🚨",
          },
          build: {
            description: "影响构建系统或外部依赖项的更改 (example scopes: gulp, broccoli, npm)",
            title: "Builds",
            emoji: "🛠",
          },
          ci: {
            description:
              "CI 配置文件和脚本的更改 (example scopes: Travis, Circle, BrowserStack, SauceLabs)",
            title: "Continuous Integrations",
            emoji: "⚙️",
          },
          chore: {
            description: "其他不修改 src 或测试文件的更改",
            title: "Chores",
            emoji: "♻️",
          },
          revert: {
            description: "恢复之前的提交",
            title: "Reverts",
            emoji: "🗑",
          },
        },
      },
      scope: {
        description: "此次变更的范围有多大 (e.g. component or file name)",
      },
      subject: {
        description: "为变更写一个简短的、命令式的时态描述",
      },
      body: { description: "提供更详细的变更描述" },
      isBreaking: { description: "是否有任何重大变化?" },
      breakingBody: {
        description: "重大变更提交需要主体。请输入提交本身的较长描述",
      },
      breaking: { description: "描述重大变化" },
      isIssueAffected: { description: "此更改是否会影响任何未解决的问题?" },
      issuesBody: {
        description: "如果问题已关闭，则提交需要正文。请输入提交本身的较长描述",
      },
      issues: {
        description: '添加问题参考 (e.g. "fix #123", "re #123".)',
      },
    },
  },
};
